package Exams.DeWu;

import java.util.HashMap;

public class q2 {
    public String[] chkBlood(String father, String mother) {
        HashMap<String, String[]> strMap = new HashMap<>();

        strMap.put("OO", new String[] { "O" });
        strMap.put("AO", new String[] { "A", "O" });
        strMap.put("AA", new String[] { "A", "O" });
        strMap.put("AB", new String[] { "A", "AB", "B", "O" });
        strMap.put("AAB", new String[] { "A", "AB", "B" });
        strMap.put("BO", new String[] { "B", "O" });
        strMap.put("BB", new String[] { "B", "O" });
        strMap.put("BAB", new String[] { "A", "AB", "B" });
        strMap.put("ABO", new String[] { "A", "B" });
        strMap.put("ABAB", new String[] { "A", "AB", "B" });

        String[] res = null;

        if (strMap.get(father + mother) == null) {
            res = strMap.get(mother + father);
        } else {
            res = strMap.get(father + mother);
        }

        return res;
    }
}
